<template>
  <div class="notFound">
    <el-empty :image-size="220" style="margin-top: 30px">
      <template #description> 无法访问，{{ time }}s后返回首页！ </template>
    </el-empty>
  </div>
</template>
<script name="notFound" setup>
import { ref, reactive } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
let time = ref(5);
let timer = null;
timer = setInterval(() => {
  if (time.value > 0) {
    time.value--;
  } else {
    clearInterval(timer);
    router.push({
      path: "/mainBox/index",
    });
  }
}, 1000);

console.log(time.value);
</script>

<style></style>
